<!DOCTYPE HTML>
<html>
<head>
    {include file="common@base/head"/}
    {block name="style"}{/block}
</head>
<body>
<!-- 主体 -->
{block name="header"}{/block}
{php} //验证登录
if(!is_login() && empty(cookie( '__forward__'))){
$forward = cookie('__forward__');
empty( $forward ) && cookie('__forward__', $_SERVER['REQUEST_URI']);
} {/php}
<div id="main-container" class="admin_container">
    {if !input('?only_body')}
    {notempty name="top_menu.core_side_menu"}
    <div class="sidebar">
        <!-- 左侧栏用户信息 -->
        <div class="user-info">
            <div class="user-info-name"><i class="layui-icon layui-icon-user"></i> {$myinfo.nickname} <i class="pl_5 fa fa-sort-down"></i>
                <div class="user-info-dropdown">
                    <a href="{:U('home/User/profile')}"><i class="layui-icon layui-icon-edit"></i> 修改密码</a>
                    <a href="{:U('home/User/logout')}"><i class="layui-icon layui-icon-return"></i> 退出</a>
                </div>
            </div>
        </div>
        <div id="sidenav">
            <ul class="sidenav_sub">
                {volist name='top_menu.core_side_menu' id='vo'}
                <li class="{$vo.class}" data-id="{$vo.id}"><a href="{$vo.url}" target="{$vo.target}"><i class="{$vo.icon}"></i> {$vo.title} </a><b class="active_arrow"></b></li>
                {/volist}
                <div class="bar"></div>
            </ul>
        </div>
    </div>
    {/notempty}
    {/if}
    {block name="container"}
    <div class="main_body {if !input('?only_body')} admin-body {/if}">
        <!-- 头部 -->
        {include file="common@base/header"/}
            <div id="update_remind" style="clear:both; margin-bottom:10px;border:1px solid #33ab07; padding:10px; background-color:#d8f9cc; color:#33ab07; position:relative; display:none">
                <a href="{:U('update/index')}">系统有新更新，请及时升级！</a>
                <a href="javascript:;" title="关闭" style="color:#999; font-size:12px; position:absolute; top:5px; right:10px; text-decoration:none" onclick="set_cookie_close_version();">
                    <i class="layui-icon layui-icon-close-fill" style="font-size: 30px; color: #1E9FFF;"></i> </a>
            </div>
        <!-- /头部 -->
        {block name="body"}{/block}
        <!-- 底部 -->
        {if !input('?only_body')}
        {include file="common@base/footer"/}
        {/if}
    </div>
    {/block}
</div>
<!-- /主体 -->
{block name="script"}{/block} <!-- 用于加载js代码 -->
<div class="hidden"><!-- 用于加载统计代码等隐藏元素 -->
    {block name="hidden"}{/block}
</div>
<!-- /底部 -->
<script>
    var cookie_close_version = 0;
    $(function () {
        // 判断一下侧边栏是否存在
        if (!$('.user-info-name').length > 0) {
            // 不存在
            $('.main_body').removeClass('admin-body')
        }
        {if condition="$need_check_update == 1"}
        $.get("{:U('admin/update/getRemoteVersion')}",{},function(res){
            if(res!=0){
                $('#update_remind').slideDown();
                cookie_close_version = res;
            }
        });
        {/if}
    });
    function set_cookie_close_version(){
        $.get("{:U('admin/update/set_cookie_close_version')}",{cookie_close_version:cookie_close_version},function(){
            $('#update_remind').slideUp();
        })
    }
</script>
</body>
</html>
